import { useAxios } from '@/hooks/web/useAxios'

const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 功能权限列表
export const faListApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminFaList',
      data: data
    }
  })
}

// 功能权限修改
export const faEditApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminFaEdit',
      data: data
    }
  })
}

// 功能权限新增
export const faAddApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminFaAdd',
      data: data
    }
  })
}

// 功能权限删除
export const faDelApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminFaDel',
      data: data
    }
  })
}
